<template>
  <div>
    <div class="banner" @click='handleBannerClick'>
      <img
        class="banner-img"
        :src="bannerImg"
        alt
      />
      <div class="banner-info">
        <div class="banner-title">{{sightName}}</div>
        <div class="banner-num">
          <span class="iconfont">&#xe61e;</span>
          39
        </div>
      </div>
    </div>
    <common-fade>
        <commonGallary v-if='showGallary' :gallaryImgs='gallaryImgs' @close='handleSwiper'></commonGallary>
    </common-fade>
  </div>
</template>
<script>
import commonGallary from "common/gallary";
import commonFade from 'common/fade'
export default {
    components: {
        commonGallary,
        commonFade
    },
    props:{
        sightName: String,
        bannerImg: String,
        gallaryImgs: Array,
        ticket: Array
    },
    data(){
        return {
            showGallary: false
        }
    },
    methods:{
        handleBannerClick(){
            this.showGallary = true;
        },
        handleSwiper(){
            this.showGallary = false;
        }
    }
};
</script>
<style lang="stylus" scoped>
.banner {
  position: relative;

  .banner-img {
    width: 100%;
  }

  .banner-info {
    color: #fff;
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    line-height: 0.6rem;
    background-image: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));

    .banner-title {
      flex: 1;
      padding-left: 0.2rem;
    }

    .banner-num {
      width: 1.3rem;
    }
  }
}
</style>

